import 'package:p_location/home/obj/home_alarm_info_detail.dart';

class ResHomeAlarmInfo {
  HomeAlarmInfoDetail data;
  int code;
  String errMsg;
  int length;
  String msg;

  ResHomeAlarmInfo({this.data, this.code, this.errMsg, this.length, this.msg});

  factory ResHomeAlarmInfo.fromJson(Map<String, dynamic> json) {
    return ResHomeAlarmInfo(
      data: json['data'] != null
          ? HomeAlarmInfoDetail.fromJson(json['data'])
          : null,
      code: json['code'],
      errMsg: json['errMsg'],
      length: json['length'],
      msg: json['msg'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['errMsg'] = this.errMsg;
    data['length'] = this.length;
    data['msg'] = this.msg;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}
